home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr49 / actlib13.zip / DATE.ZIP / GETDTIME.C < prev   
Text File  |  1993-01-14  |  934b  |  45 lines

  1. /*  Copyright (C) 1993   Marc Stern  (internet: stern@mble.philips.be)  */
  2.  
  3. #include "date.h"
  4. #include <stdlib.h>
  5. #include <memory.h>
  6. #include <time.h>
  7.  
  8.  
  9. /***
  10.  *
  11.  *  Function getdtime :   Get current time and date
  12.  *
  13.  *  Parameters        :   Pointer to time & date structure
  14.  *
  15.  ***/
  16.  
  17. void getdtime( struct tm *dtime )
  18.  
  19. { time_t timer;
  20.   struct tm *tmp;
  21.  
  22.   time( &timer );          /* get time of day */
  23.  
  24.   tmp = localtime( &timer );   /* converts date/time to a structure */
  25.   memcpy( dtime , tmp , sizeof(struct tm) );
  26.  
  27. #ifdef XXXXX
  28.   _AH = 0x2A ;  asm int 0x21 ;
  29.   dtime.tm_wday = _AL ;
  30.   dtime.tm_year = _CX ;
  31.   dtime.tm_mon  = _DH ;
  32.   dtime.tm_day  = _DL ;
  33.  
  34.   _AH = 0x2C ;  asm int 0x21 ;
  35.   dtime.tm_hour = _CH ;
  36.   dtime.tm_min  = _CL ;
  37.   dtime.tm_sec  = _DH ;
  38.   dtime.tm_hour = _CH ;
  39.  
  40.   /*  call mktime to fill in remaining fields of the structure */
  41.   mktime( &dtime ) ;
  42. #endif
  43. }
  44.  
  45.